home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 102 / CD-ROM 102.iso / aplic / 2sync / 2SyncSetup.exe / settings / scripts / frame_1 / DoAction_2.as next >
Encoding:
Text File  |  2002-03-20  |  4.0 KB  |  122 lines

  1. _level0.env = new Object();
  2. _level0.env.ch = new Object();
  3. _level0.env.ch.colour = {n_dark_ra:39,n_dark_ga:41,n_dark_ba:63,n_dark_aa:100,n_light_ra:51,n_light_ga:55,n_light_ba:77,n_light_aa:100,n_text_ra:100,n_text_ga:100,n_text_ba:100,n_text_aa:100,o_dark_ra:16,o_dark_ga:18,o_dark_ba:41,o_dark_aa:100,o_light_ra:19,o_light_ga:20,o_light_ba:41,o_light_aa:100,o_text_ra:100,o_text_ga:100,o_text_ba:100,o_text_aa:100,p_dark_ra:19,p_dark_ga:20,p_dark_ba:41,p_dark_aa:100,p_light_ra:19,p_light_ga:20,p_light_ba:41,p_light_aa:100,p_text_ra:100,p_text_ga:100,p_text_ba:100,p_text_aa:100};
  4. _level0.colour = function(me)
  5. {
  6.    if(_level0.colourSet != true)
  7.    {
  8.       _level0.setChannelColour();
  9.       _level0.colourSet = true;
  10.    }
  11.    this.state = new Object();
  12.    this.state.clear = _level0.env.ch.clear;
  13.    this.state.none = _level0.env.ch.none;
  14.    this.state.normal = _level0.env.ch.normal;
  15.    this.state.over = _level0.env.ch.over;
  16.    this.state.pressed = _level0.env.ch.pressed;
  17.    this.dInst = new Color(me.dark);
  18.    this.lInst = new Color(me.light);
  19.    this.tInst = new Color(me.text);
  20.    this.setState = colourObj_setState;
  21.    this.none = function()
  22.    {
  23.       this.setState("none");
  24.    };
  25.    this.normal = function()
  26.    {
  27.       this.setState("normal");
  28.    };
  29.    this.rollover = function()
  30.    {
  31.       this.setState("over");
  32.    };
  33.    this.pressed = function()
  34.    {
  35.       this.setState("pressed");
  36.    };
  37.    this.clear = function()
  38.    {
  39.       this.setState("clear");
  40.    };
  41.    this.init = colourObj_init;
  42.    this.refresh = colourObj_refresh;
  43.    this.init();
  44.    _level0.colourObjStack.push(me);
  45. };
  46. _level0.colourObj_setState = function(which)
  47. {
  48.    this.dInst.setTransform(this.state[which].dark);
  49.    this.lInst.setTransform(this.state[which].light);
  50.    this.tInst.setTransform(this.state[which].text);
  51.    this.currentState = which;
  52. };
  53. _level0.colourObj_init = function()
  54. {
  55.    this.normal();
  56. };
  57. _level0.colourObj_refresh = function()
  58. {
  59.    this.state.normal = _level0.env.ch.normal;
  60.    this.state.over = _level0.env.ch.over;
  61.    this.state.pressed = _level0.env.ch.pressed;
  62.    this.state.clear = _level0.env.ch.clear;
  63.    this.setState(this.currentState);
  64. };
  65. _level0.setChannelColour = function()
  66. {
  67.    if(_level0.env != null && _level0.env.ch != null)
  68.    {
  69.       var tempObjRef = _level0.env.ch;
  70.       var states = ["normal","over","pressed"];
  71.       var colObjects = ["dark","light","text"];
  72.       var setTrans = ["ra","rb","ga","gb","ba","bb","aa","ab"];
  73.       tempObjRef.none = new Object();
  74.       tempObjRef.none.dark = {ra:100,rb:0,ga:100,gb:0,ba:100,bb:0,aa:100,ab:0};
  75.       tempObjRef.none.light = {ra:100,rb:0,ga:100,gb:0,ba:100,bb:0,aa:100,ab:0};
  76.       tempObjRef.none.text = {ra:100,rb:0,ga:100,gb:0,ba:100,bb:0,aa:100,ab:0};
  77.       tempObjRef.clear = new Object();
  78.       tempObjRef.clear.dark = {ra:0,rb:0,ga:0,gb:0,ba:0,bb:0,aa:0,ab:0};
  79.       tempObjRef.clear.light = {ra:0,rb:0,ga:0,gb:0,ba:0,bb:0,aa:0,ab:0};
  80.       tempObjRef.clear.text = {ra:0,rb:0,ga:0,gb:0,ba:0,bb:0,aa:0,ab:0};
  81.       i = 0;
  82.       while(i < states.length)
  83.       {
  84.          tempObjRef[states[i]] = new Object();
  85.          var stateObj = tempObjRef[states[i]];
  86.          c = 0;
  87.          while(c < colObjects.length)
  88.          {
  89.             stateChar1 = states[i].charAt(0);
  90.             stateObj[colObjects[c]] = new Object();
  91.             t = 0;
  92.             while(t < setTrans.length)
  93.             {
  94.                stateObj[colObjects[c]][setTrans[t]] = tempObjRef.colour[stateChar1 + "_" + colObjects[c] + "_" + setTrans[t]];
  95.                t++;
  96.             }
  97.             c++;
  98.          }
  99.          i++;
  100.       }
  101.       if(_level0.colourObjStack == null)
  102.       {
  103.          _level0.colourObjStack = [];
  104.       }
  105.       else
  106.       {
  107.          for(i in "_level0:colourObjStack")
  108.          {
  109.             if(_level0.colourObjStack[i]._target == null)
  110.             {
  111.                _level0.colourObjStack.splice(i,1);
  112.             }
  113.             else
  114.             {
  115.                _level0.colourObjStack[i].colour.refresh();
  116.             }
  117.          }
  118.       }
  119.    }
  120. };
  121. stop();
  122.